import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 列表查询 */
export const getProjectList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/project/page"), {
    params: filerEmptyVal(params)
  });
};

/** 详情 */
export const getProjectDetail = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/project/detail"), {
    params: filerEmptyVal(params)
  });
};

/** 新增 */
export const addProject = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/project/add"), {
    data: filerEmptyVal(data)
  });
};

/** 审核 */
export const checkProject = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/project/examineStatus"), {
    data: filerEmptyVal(data)
  });
};

/** 修改 */
export const upProject = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/project/update"), {
    data
  });
};

/** 删除 */
export const delProject = (dataId?: number) => {
  return http.request<any>("post", baseUrlApi("/project/delete?id=" + dataId));
};
